1. Field of Invention
The invention relates to an apparatus and a method for drawing, in particular, to an apparatus and a method for line drawing.
2. Related Art
Data processing systems that are primarily employed for graphics processes are used in many different areas of industry, business, education, and government. Graphics applications for these systems include interactive planning, office automation, electronic publishing, animation, and computer-aided design. Further, graphics processing technology develops rapidly as does the progress of hardware technology, such as data processors.
Referring to FIGS. 1A and 1B, in general, a plurality of pixels, on which a line 10 is drawn, display line color to draw line 10. At the same time other pixels of a displaying apparatus display background color, so that the image of line 10 can be drawn.
However, the image of line 10 is presented as an obvious ladder-shape. In order to solve the problem of the mentioned ladder-shape, skilled individuals determine the color of each pixel according to the distance between each pixel and line 10. In other words, if a pixel is nearer to line 10, the color Color(pixel) of this pixel is closer to the line color Color(line); if a pixel is farther away from line 10, the color Color(pixel) of this pixel is closer to the background color Color(background). Thus the image of line 10 would not be presented as an obvious ladder-shape, and the width of line 10 is also shown. As mentioned above, the color Color(pixel) of pixels is computed by blending the line color Color(line) and the background color Color(background) with a blending factor α as shown in the following formula (1):Color(pixel)=α×Color(line)+(1−α)×Color(background)  (1) 
Wherein, the blending factor α is computed according to the slope of line 10 and the distance between each pixel and line 10. In this case, the value of the blending factor is no less than 0 and no greater than 1. As shown in FIG. 2, the slope of line 10 is m, the width of line 10 is dmax, and the distance between a pixel 20 and line 10 in the vertical axle direction is D. Therefore, the blending factor α is computed following the formula (2):                                                ⁢                  α          =                      {                                                                                                                              1                        -                                                  d                                                      d                            max                                                                                              ,                                                                                                  d                      ≤                                              d                        max                                                                                                                                                        0                      ,                                                                                                  d                      >                                              d                        max                                                                                                        ⁢                                                          ⁢              Wherein              ⁢                              :                                                                        (        2        )                                                           ⁢                  d          =                      D                                          1                +                                  m                  2                                                                                        (        3        )            
Consequently, line 10 displayed following this method, shown in FIG. 2, would not present the mentioned ladder-shape as shown in FIG. 1. However, because the data processor has to calculate the formula (1), (2), and (3) for each of the pixels, in particular, to compute a root while calculating the formula (3), the calculation time required by the data processor increases. Moreover, this affects the display speed, so the image display is delayed. It would be desirable, therefore, to provide an apparatus and a method that would reduce calculation time when computing the blending factors for pixels, so as to avoid delay in drawing the image.